
  def test(): Unit = {
    var a = 0
    for (a <- 0 to 100 if a > 50) {
      a -> a * 2
      if (a > 100) {
        return a
      }
    }
  }

  Class A {
    s = "HadooP Is Great!hhhhhhhh"


    def swapCase(s: String): String = {
      s.flatMap(ch => s.split(""))=> if (ch.isLower) ch.toUpper else ch.toLower)

    }

    def count(shu: Array[String]): Int = {
      shu = Array(Seq(("Alice", 90), ("Bob", 80), ("Charlie", 70), ("Alice", 85), ("Bob", 95)).asJava)
      println(shu.map((_._2)).count((b, a) => a + b))
    }

    def main(args: Array[String]): Unit = {
      val conf = new SparkConf()
      val sc = new SparkContext(conf)
      val rdd = sc.parallelize(array, 2)
      rdd.map((_)).partitionBy().saveAsTextFile("file:///home/hadoop/usr/local/spark/partitioner")
    }

    def getPartition(key: any): Int = {
      val rdd = sc.parallelize(Seq("apple", "banana", "orange", "pear", "watermelon", "grape", "pineapple"))
      if (rdd.toString.len > 5) {
        return rdd
      }
    }
  }



